//package cn.iocoder.yudao.module.yyzx.controller.admin.health_records;
//
//import cn.iocoder.yudao.framework.apilog.core.annotations.ApiAccessLog;
//import cn.iocoder.yudao.framework.common.pojo.CommonResult;
//import cn.iocoder.yudao.framework.common.pojo.PageParam;
//import cn.iocoder.yudao.framework.common.pojo.PageResult;
//import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
//import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
//import cn.iocoder.yudao.module.yyzx.controller.admin.health_records.vo.BedPageReqVO;
//import cn.iocoder.yudao.module.yyzx.controller.admin.health_records.vo.BedRespVO;
//import cn.iocoder.yudao.module.yyzx.service.bed_manage.Bed_ManageService;
//import io.swagger.v3.oas.annotations.Operation;
//import io.swagger.v3.oas.annotations.Parameter;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletResponse;
//import javax.validation.Valid;
//import java.io.IOException;
//import java.util.List;
//
//import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
//import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
//
//@Tag(name = "管理后台 - 床位信息")
//@RestController
//@RequestMapping("/yyzx/bed_manage")
//@Validated
//public class Bed_ManageController {
//
//    @Resource
//    private Bed_ManageService bedService;
//
//    @PostMapping("/create")
//    @Operation(summary = "创建床位信息")
//    @PreAuthorize("@ss.hasPermission('yyzx:bed:create')")
//    public CommonResult<Integer> createBed(@Valid @RequestBody BedRespVO createReqVO) {
//        return success(bedService.createBed(createReqVO));
//    }
//
//    @PutMapping("/update")
//    @Operation(summary = "更新床位信息")
//    @PreAuthorize("@ss.hasPermission('yyzx:bed:update')")
//    public CommonResult<Boolean> updateBed(@Valid @RequestBody BedRespVO updateReqVO) {
//        bedService.updateBed(updateReqVO);
//        return success(true);
//    }
//
//    @DeleteMapping("/delete")
//    @Operation(summary = "删除床位信息")
//    @Parameter(name = "id", description = "编号", required = true)
//    @PreAuthorize("@ss.hasPermission('yyzx:bed:delete')")
//    public CommonResult<Boolean> deleteBed(@RequestParam("cid") Integer cid,@RequestParam("bid") Integer bid) {
//        bedService.deleteBed(cid,bid);
//        return success(true);
//    }
//
//    @GetMapping("/get")
//    @Operation(summary = "获得床位信息")
//    @Parameter(name = "id", description = "编号", required = true, example = "1024")
//    @PreAuthorize("@ss.hasPermission('yyzx:bed:query')")
//    public CommonResult<BedRespVO> getBed(@RequestParam("id") Integer id) {
//        BedRespVO bed = bedService.getBed(id);
//        return success(BeanUtils.toBean(bed, BedRespVO.class));
//    }
//
//    @GetMapping("/page")
//    @Operation(summary = "获得床位信息分页")
//    @PreAuthorize("@ss.hasPermission('yyzx:bed:query')")
//    public CommonResult<PageResult<BedPageReqVO>> getBedPage(@Valid BedPageReqVO pageReqVO) {
//        PageResult<BedPageReqVO> pageResult = bedService.getBedPage(pageReqVO);
//        System.out.println("pageResult = " + pageResult);
//        return success(BeanUtils.toBean(pageResult, BedPageReqVO.class));
//    }
//
//    @GetMapping("/export-excel")
//    @Operation(summary = "导出床位信息 Excel")
//    @PreAuthorize("@ss.hasPermission('yyzx:bed:export')")
//    @ApiAccessLog(operateType = EXPORT)
//    public void exportBedExcel(@Valid BedPageReqVO pageReqVO,
//                               HttpServletResponse response) throws IOException {
//        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
//        List<? extends BedPageReqVO> list = bedService.getBedPage(pageReqVO).getList();
//        // 导出 Excel
//        ExcelUtils.write(response, "床位信息.xls", "数据", BedRespVO.class,
//                BeanUtils.toBean(list, BedRespVO.class));
//    }
//
//}